package com.br.sae.controls;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.br.sae.conexaobd.SistemaDAO;
import com.br.sae.model.entitys.Disciplina;

public class LogicaSetDisciplina implements Logica{

	@Override
	public String executa(HttpServletRequest req, HttpServletResponse res)
			throws Exception {
		int id = Integer.valueOf(req.getParameter("id"));
		SistemaDAO sistemaDAO = new SistemaDAO();
		Disciplina disciplina = (Disciplina) sistemaDAO.find(Disciplina.class, id);
		
		req.setAttribute("disciplina", disciplina);
		
		return "cadastro_disciplina.jsp?Metodo=alterarDisciplina";
	}
	
}
